<?php
session_start();
if(isset($_SESSION['spelerId']) && $_SESSION['spelerId'] == '2') {
	//Database gebruikersnaam: root, wachtwoord: usbw
	$con = mysql_connect("localhost","deb57849_topspin","xW1e600C");
	if (!$con)
	{
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("deb57849_topspin", $con);
	
	function getSkill($value) {
		switch(strtolower($value)) {
			case 0:		return null;
			case 1:		return 'Amazing first volley';
			case 2:		return 'Approach shots expert';
			case 3:		return 'Brutal volley';
			case 4:		return 'Crushing passing shot';
			case 5:		return 'Diesel hard hitter';
			case 6:		return 'Diesel returner';
			case 7:		return 'Diesel server';
			case 8:		return 'Drop shot artist';
			case 9:		return 'Fatality';
			case 10:	return 'Focus service';
			case 11:	return 'Highly flammable';
			case 12:	return 'Inside out master';
			case 13:	return 'Instant rocket';
			case 14:	return 'Longer, better!';
			case 15:	return 'Low volley specialist';
			case 16:	return 'Monster defense';
			case 17:	return 'Passing shot sniper';
			case 18:	return 'Poisoned slices';
			case 19:	return 'Reach swings expert';
			case 20:	return 'Return serve counter';
			case 21:	return 'Semi-volley king';
			case 22:	return 'Serve stick berserker';
			case 23:	return 'Shot counter';
			case 24:	return 'Slice invasion';
			case 25:	return 'Smell of blood';
			case 26:	return 'Spectacular volleys';
			case 27:	return 'Spin serve master';
			case 28:	return 'Top spin invasion';
			case 29:	return 'Volley shots artist';
			case 30:	return 'Wrong foot expert';
			default:	return null;
		}
	}
		
	if(!empty($_GET['ps_id_naam']) || !empty($_GET['naam'])) {
		$result = mysql_query("SELECT ps_id.*, speler.*, wedstrijd.*, mijnspeler.naam AS mijnspeler_naam FROM ps_id, speler, wedstrijd
			LEFT JOIN mijnspeler ON wedstrijd.mijnspelerId = mijnspeler.mijnspelerId
			WHERE ".(!empty($_GET['ps_id_naam']) ? "ps_id.ps_id_naam = '".$_GET['ps_id_naam']."'" : "").(!empty($_GET['naam']) ? (!empty($_GET['ps_id_naam']) ? " AND " : "")."speler.naam = '".$_GET['naam']."'" : "")."
				AND speler.ps_id = ps_id.ps_id
				AND wedstrijd.speler_id = speler.speler_id
			ORDER BY wedstrijd.gespeeld_op DESC, speler.naam, ps_id.ps_id_naam");
	}else {
		// LAAT DE 3 LAATST GESPEELDE WEDSTRIJDEN ZIEN ------------------------ */
		$result = mysql_query("SELECT ps_id.*, speler.*, wedstrijd.*, mijnspeler.naam AS mijnspeler_naam FROM ps_id, speler, wedstrijd
			LEFT JOIN mijnspeler ON wedstrijd.mijnspelerId = mijnspeler.mijnspelerId
			WHERE speler.ps_id = ps_id.ps_id
				AND wedstrijd.speler_id = speler.speler_id
			ORDER BY wedstrijd.gespeeld_op DESC, speler.naam, ps_id.ps_id_naam
			LIMIT 3");
	}
	if($result <> null && mysql_num_rows($result) > 0) {
		include('./dag_maand.php');
		if(!empty($_GET['ps_id_naam']) || !empty($_GET['naam'])) {
			echo "<h2>Wedstrijden</h2>";
		}else {
			echo "<h2>De laatst gespeelde wedstrijden</h2>";
		}
		while($row = mysql_fetch_array($result)) {
			if(isset($row['speler_id'])) {
				// WON/LOSS -------------------------------------------------
				if(empty($row['wedstrijd_onbeslist'])) {
					switch($row['win']) {
						case 0:		$win = "Verloren";		break;
						case 1:		$win = "Gewonnen";		break;
						case 2:		$win = "Gelijk";		break;
						default:	$win = "Onbeslist";		break;
					}
				}else {
					// WEDSTRIJD IS NIET AFGEMAAKT
					switch($row['wedstrijd_onbeslist']) {
						case 0:		$win = "Onbeslist";				break;
						case 1:		$win = "Gewonnen (hij wo)";		break;
						case 2:		$win = "Verloren (hij wo)";		break;
						case 3:		$win = "Onbeslist (hij wo)";	break;
						case 4:		$win = "Gewonnen (ik wo)";		break;
						case 5:		$win = "Verloren (ik wo)";		break;
						case 6:		$win = "Onbeslist (ik wo)";		break;
						case 7:		$win = "Gewonnen (cl)";			break;
						case 8:		$win = "Verloren (cl)";			break;
						case 9:		$win = "Onbeslist (cl)";		break;
						default:	$win = "Onbeslist";				break;
					}
				}
				
				echo "<div class='wedstrijd_info'>";
					echo "<p class='meta'>
					<span class='meta_speler' data-naam='".$row['naam']."' data-ps_id_naam='".$row['ps_id_naam']."' data-special1='".getSkill($row['special1'])."' data-special2='".getSkill($row['special2'])."' rel='
					<input type=\"hidden\" name=\"wijzig\" value=\"".$row['speler_id']."\">
						<label for=\"man\">man</label>
						<input id=\"man\" type=\"checkbox\" name=\"man\"".(empty($row['man']) ? "" : " checked=\"yes\"").">
					<br>
						<label for=\"fh\">fh</label>
						<input id=\"fh\" class=\"padding\" type=\"text\" name=\"fh\" value=\"".$row['fh']."\">
					<br>
						<label for=\"bh\">bh</label>
						<input id=\"bh\" class=\"padding\" type=\"text\" name=\"bh\" value=\"".$row['bh']."\">
					<br>
						<label for=\"srv\">srv</label>
						<input id=\"srv\" class=\"padding\" type=\"text\" name=\"srv\" value=\"".$row['srv']."\">
					<br>
						<label for=\"vol\">vol</label>
						<input id=\"vol\" class=\"padding\" type=\"text\" name=\"vol\" value=\"".$row['vol']."\">
					<br>
						<label for=\"pow\">pow</label>
						<input id=\"pow\" class=\"padding\" type=\"text\" name=\"pow\" value=\"".$row['pow']."\">
					<br>
						<label for=\"sta\">sta</label>
						<input id=\"sta\" class=\"padding\" type=\"text\" name=\"sta\" value=\"".$row['sta']."\">
					<br>
						<label for=\"spe\">spe</label>
						<input id=\"spe\" class=\"padding\" type=\"text\" name=\"spe\" value=\"".$row['spe']."\">
					<br>
						<label for=\"ref\">ref</label>
						<input id=\"ref\" class=\"padding\" type=\"text\" name=\"ref\" value=\"".$row['ref']."\">'>
						".$row['naam']."</span><span class='meta_ps_id' rel='".$row['ps_id_naam']."'>".$row['ps_id_naam']."</span><span class='resultaat ".$win."'>".$win."</span></p>";
					
					// GESPEELD MET ----------------------------
					if(isset($row['mijnspeler_naam'])) {
						echo "<p style='margin: 4px 0px; text-align: center;'>".$row['mijnspeler_naam']."</p>";
						echo "<div class='clear'></div>";
					}
					
					// ONDERGROND BEPALEN -----------------------
					$ondergrond = null;
					switch($row['ondergrond']) {
						case '0':	$ondergrond = "hardcourt.png";	break;
						case '1':	$ondergrond = "gravel.png";		break;
						case '2':	$ondergrond = "gras.png";		break;
						case '3':	$ondergrond = "tapijt.png";		break;
						default:	$ondergrond = null;				break;
					}

					// STERKTE BEPALEN ---------------------------
					$speel_sterkte = null;
					switch($row['speelsterkte']) {
						case '0':	$speel_sterkte = "Heel erg slecht";	break;
						case '1':	$speel_sterkte = "Zeer slecht";		break;
						case '2':	$speel_sterkte = "Slecht";			break;
						case '3':	$speel_sterkte = "Redelijk";		break;
						case '4':	$speel_sterkte = "Net iets slechter";	break;
						case '5':	$speel_sterkte = "Net zo goed als ik";			break;
						case '6':	$speel_sterkte = "Net iets beter dan ik";		break;
						case '7':	$speel_sterkte = "Beter dan ik";	break;
						case '8':	$speel_sterkte = "Veel beter dan ik";			break;
						case '9':	$speel_sterkte = "Wordt weggespeeld";			break;
						case '10':	$speel_sterkte = "Onmogelijk";		break;
						default:	$speel_sterkte = "Onbekend";		break;
					}
					
					
					/* HET LINKER GEDEELTE NEERZETTEN (attributes en skills) */
					echo "<div class='left'>";
						echo "<p class='sterkte'><span class='sterkte_bar'></span><span class='sterkte_indicator' style='left:-".(186 - $row['speelsterkte'] * 18)."px'></span></p>";
						echo "<p class='grade'>".(isset($row['players_grade']) ? "Grade: ".$row['players_grade'] : "")."</p>";
						echo "<table class='attributes' cellspacing='0'>";
							echo "<tr>";
								echo "<td class='attr_name'>fh</td>";
								echo "<td ".(empty($row['fh']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['fh'] < 50 ? "grijs" : ($row['fh'] >= 50 && $row['fh'] <= 65 ? "geel" : ($row['fh'] > 65 && $row['fh'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['fh']."%;'><span>".$row['fh']."</span></div></td>")."</tr>";
							echo "<tr>";
								echo "<td class='attr_name'>bh</td>";
								echo "<td ".(empty($row['bh']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['bh'] < 50 ? "grijs" : ($row['bh'] >= 50 && $row['bh'] <= 65 ? "geel" : ($row['bh'] > 65 && $row['bh'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['bh']."%;'><span>".$row['bh']."</span></div></td>")."</tr>";
							echo "<tr>";
								echo "<td class='attr_name'>srv</td>";
								echo "<td ".(empty($row['srv']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['srv'] < 50 ? "grijs" : ($row['srv'] >= 50 && $row['srv'] <= 65 ? "geel" : ($row['srv'] > 65 && $row['srv'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['srv']."%;'><span>".$row['srv']."</span></div></td>")."</tr>";
							echo "<tr>";
								echo "<td class='attr_name'>vol</td>";
								echo "<td ".(empty($row['vol']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['vol'] < 50 ? "grijs" : ($row['vol'] >= 50 && $row['vol'] <= 65 ? "geel" : ($row['vol'] > 65 && $row['vol'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['vol']."%;'><span>".$row['vol']."</span></div></td>")."</tr>";
							echo "<tr>";
								echo "<td class='attr_name'>pow</td>";
								echo "<td ".(empty($row['pow']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['pow'] < 50 ? "grijs" : ($row['pow'] >= 50 && $row['pow'] <= 65 ? "geel" : ($row['pow'] > 65 && $row['pow'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['pow']."%;'><span>".$row['pow']."</span></div></td>")."</tr>";
							echo "<tr>";
								echo "<td class='attr_name'>sta</td>";
								echo "<td ".(empty($row['sta']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['sta'] < 50 ? "grijs" : ($row['sta'] >= 50 && $row['sta'] <= 65 ? "geel" : ($row['sta'] > 65 && $row['sta'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['sta']."%;'><span>".$row['sta']."</span></div></td>")."</tr>";
							echo "<tr>";
								echo "<td class='attr_name'>spe</td>";
								echo "<td ".(empty($row['spe']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['spe'] < 50 ? "grijs" : ($row['spe'] >= 50 && $row['spe'] <= 65 ? "geel" : ($row['spe'] > 65 && $row['spe'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['spe']."%;'><span>".$row['spe']."</span></div></td>")."</tr>";
							echo "<tr>";
								echo "<td class='attr_name'>ref</td>";
								echo "<td ".(empty($row['ref']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['ref'] < 50 ? "grijs" : ($row['ref'] >= 50 && $row['ref'] <= 65 ? "geel" : ($row['ref'] > 65 && $row['ref'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['ref']."%;'><span>".$row['ref']."</span></div></td>")."</tr>";
						echo "</table>";
						
						/* OPVRAGEN WELKE SKILLS HIJ HEEFT */
						if(!empty($row['special1']) || !empty($row['special2'])) {
							$skill_geplaatst = false;
							echo "<p class='skills'>";
							for($i = 0; $i < 2; $i++) {
								$value = 0;
								if($i == 0 && !empty($row['special1'])) {
									$value = $row['special1'];
								}
								if($i == 1 && !empty($row['special2'])) {
									$value = $row['special2'];
								}
								$skill = getSkill($value);
								if(!empty($skill)) {
									if($skill_geplaatst) {	echo "<br>";}
									echo $skill;
									$skill_geplaatst = true;
								}
							}
							echo "</p>";
						}
					echo "</div>";	// END FLOAT:LEFT
					
					/* HET RECHTER GEDEELTE NEERZETTEN (ondergrond, uitslag, puntenverdeling en opmerking) */
					echo "<div class='right'>";
						// DATUM
						echo "<p class='speeldatum'>".date('d', strtotime($row['gespeeld_op']))." ".getMaandString(date('m', strtotime($row['gespeeld_op'])), false)." ".date('Y', strtotime($row['gespeeld_op'])).", ".date('H:i', strtotime($row['gespeeld_op']))."</p>";
						// ONDERGROND
						if(!empty($ondergrond)) {
							echo "<img class='ondergrond' src='/images/".$ondergrond."'>";	
						}
						
						// UITSLAG
						echo "<table class='uitslag' cellspacing='0'>";
							echo "<tr class='first_row'>";
								echo "<td class='naam'>Ik</td>";
								if(isset($row['games_voor_set1']) && isset($row['games_tegen_set1'])) {
									echo "<td".($row['games_voor_set1'] > $row['games_tegen_set1'] ? " class='set_gewonnen'" : "").">".$row['games_voor_set1']."</td>";
									if(isset($row['games_voor_set2']) && isset($row['games_tegen_set2'])) {
										echo "<td".($row['games_voor_set2'] > $row['games_tegen_set2'] ? " class='set_gewonnen'" : "").">".$row['games_voor_set2']."</td>";
										if(isset($row['games_voor_set3']) && isset($row['games_tegen_set3'])) {
											echo "<td".($row['games_voor_set3'] > $row['games_tegen_set3'] ? " class='set_gewonnen'" : "").">".$row['games_voor_set3']."</td>";
										}
									}
								}
							echo "</tr>";
							echo "<tr>";
								echo "<td class='naam'>Hij</td>";
								if(isset($row['games_voor_set1']) && isset($row['games_tegen_set1'])) {
									echo "<td".($row['games_tegen_set1'] > $row['games_voor_set1'] ? " class='set_gewonnen'" : "").">".$row['games_tegen_set1']."</td>";
									if(isset($row['games_voor_set2']) && isset($row['games_tegen_set2'])) {
										echo "<td".($row['games_tegen_set2'] > $row['games_voor_set2'] ? " class='set_gewonnen'" : "").">".$row['games_tegen_set2']."</td>";
										if(isset($row['games_voor_set3']) && isset($row['games_tegen_set3'])) {
											echo "<td".($row['games_tegen_set3'] > $row['games_voor_set3'] ? " class='set_gewonnen'" : "").">".$row['games_tegen_set3']."</td>";
										}
									}
								}
							echo "</tr>";
						echo "</table>";
							
						//PUNTEN VOOR/TEGEN
						if(isset($row['pnt_voor']) && isset($row['pnt_tegen'])) {
							echo "<p>Punten voor/tegen: ".$row['pnt_voor']."-".$row['pnt_tegen']."</p>";
						}
						
						//OPMERKING
						if(isset($row['opmerking'])) {
							echo "<p class='opmerking'><u>Opmerking:</u><br>".$row['opmerking']."</p>";
						}
					echo "</div>";	// END FLOAT:RIGHT
					
					echo "<div class='clear'></div>";
					
					if(isset($row['hoe_ik_gespeeld'])) {
						echo "<p class='hoe_ik_gespeeld'><u>Hoe speelde ik:</u><br>".$row['hoe_ik_gespeeld']."</p>";
					}
					if(isset($row['hoe_hij_gespeeld'])) {
						echo "<p class='hoe_hij_gespeeld'><u>Hoe speelde hij:</u><br>".$row['hoe_hij_gespeeld']."</p>";
					}
				echo "</div>";	// END WEDSTRIJDINFO
				echo "<div style='clear: both;'></div>";
			}
		}
	}
		
	if(!empty($_GET['ps_id_naam']) || !empty($_GET['naam'])) {
		/* Spelers opvragen die horen bij de ps_id_naam */
		$result = mysql_query("SELECT * FROM `ps_id`, `speler`
			WHERE ".(!empty($_GET['ps_id_naam']) ? "ps_id.ps_id_naam = '".$_GET['ps_id_naam']."'" : "").(!empty($_GET['naam']) ? (!empty($_GET['ps_id_naam']) ? " AND " : "")."speler.naam = '".$_GET['naam']."'" : "")."
				AND speler.ps_id = ps_id.ps_id
			ORDER BY speler.naam, ps_id.ps_id_naam, speler.speler_id");
		if($result <> null && mysql_num_rows($result) > 0) {
			echo "<h2>Spelers</h2>";
			$left = true;
			while($row = mysql_fetch_array($result)) {
				echo "<div class='speler_info".($left ? " left" : " right")."'>";
					echo "<p class='meta'>
						<span class='meta_speler' data-naam='".$row['naam']."' data-ps_id_naam='".$row['ps_id_naam']."' data-special1='".getSkill($row['special1'])."' data-special2='".getSkill($row['special2'])."' rel='
						<input type=\"hidden\" name=\"wijzig\" value=\"".$row['speler_id']."\">
							<label for=\"man\">man</label>
							<input id=\"man\" type=\"checkbox\" name=\"man\"".(empty($row['man']) ? "" : " checked=\"yes\"").">
						<br>
							<label for=\"fh\">fh</label>
							<input id=\"fh\" class=\"padding\" type=\"text\" name=\"fh\" value=\"".$row['fh']."\">
						<br>
							<label for=\"bh\">bh</label>
							<input id=\"bh\" class=\"padding\" type=\"text\" name=\"bh\" value=\"".$row['bh']."\">
						<br>
							<label for=\"srv\">srv</label>
							<input id=\"srv\" class=\"padding\" type=\"text\" name=\"srv\" value=\"".$row['srv']."\">
						<br>
							<label for=\"vol\">vol</label>
							<input id=\"vol\" class=\"padding\" type=\"text\" name=\"vol\" value=\"".$row['vol']."\">
						<br>
							<label for=\"pow\">pow</label>
							<input id=\"pow\" class=\"padding\" type=\"text\" name=\"pow\" value=\"".$row['pow']."\">
						<br>
							<label for=\"sta\">sta</label>
							<input id=\"sta\" class=\"padding\" type=\"text\" name=\"sta\" value=\"".$row['sta']."\">
						<br>
							<label for=\"spe\">spe</label>
							<input id=\"spe\" class=\"padding\" type=\"text\" name=\"spe\" value=\"".$row['spe']."\">
						<br>
							<label for=\"ref\">ref</label>
							<input id=\"ref\" class=\"padding\" type=\"text\" name=\"ref\" value=\"".$row['ref']."\">'>
							".$row['naam']."</span></p>";
							
					echo "<table class='attributes' cellspacing='0'>";
						echo "<tr>";
							echo "<td class='attr_name'>fh</td>";
							echo "<td ".(empty($row['fh']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['fh'] < 50 ? "grijs" : ($row['fh'] >= 50 && $row['fh'] <= 65 ? "geel" : ($row['fh'] > 65 && $row['fh'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['fh']."%;'><span>".$row['fh']."</span></div></td>")."</tr>";
						echo "<tr>";
							echo "<td class='attr_name'>bh</td>";
							echo "<td ".(empty($row['bh']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['bh'] < 50 ? "grijs" : ($row['bh'] >= 50 && $row['bh'] <= 65 ? "geel" : ($row['bh'] > 65 && $row['bh'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['bh']."%;'><span>".$row['bh']."</span></div></td>")."</tr>";
						echo "<tr>";
							echo "<td class='attr_name'>srv</td>";
							echo "<td ".(empty($row['srv']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['srv'] < 50 ? "grijs" : ($row['srv'] >= 50 && $row['srv'] <= 65 ? "geel" : ($row['srv'] > 65 && $row['srv'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['srv']."%;'><span>".$row['srv']."</span></div></td>")."</tr>";
						echo "<tr>";
							echo "<td class='attr_name'>vol</td>";
							echo "<td ".(empty($row['vol']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['vol'] < 50 ? "grijs" : ($row['vol'] >= 50 && $row['vol'] <= 65 ? "geel" : ($row['vol'] > 65 && $row['vol'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['vol']."%;'><span>".$row['vol']."</span></div></td>")."</tr>";
						echo "<tr>";
							echo "<td class='attr_name'>pow</td>";
							echo "<td ".(empty($row['pow']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['pow'] < 50 ? "grijs" : ($row['pow'] >= 50 && $row['pow'] <= 65 ? "geel" : ($row['pow'] > 65 && $row['pow'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['pow']."%;'><span>".$row['pow']."</span></div></td>")."</tr>";
						echo "<tr>";
							echo "<td class='attr_name'>sta</td>";
							echo "<td ".(empty($row['sta']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['sta'] < 50 ? "grijs" : ($row['sta'] >= 50 && $row['sta'] <= 65 ? "geel" : ($row['sta'] > 65 && $row['sta'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['sta']."%;'><span>".$row['sta']."</span></div></td>")."</tr>";
						echo "<tr>";
							echo "<td class='attr_name'>spe</td>";
							echo "<td ".(empty($row['spe']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['spe'] < 50 ? "grijs" : ($row['spe'] >= 50 && $row['spe'] <= 65 ? "geel" : ($row['spe'] > 65 && $row['spe'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['spe']."%;'><span>".$row['spe']."</span></div></td>")."</tr>";
						echo "<tr>";
							echo "<td class='attr_name'>ref</td>";
							echo "<td ".(empty($row['ref']) ? "class='no_attr_value'>-</td>" : "class='attr_value'><div class='".($row['ref'] < 50 ? "grijs" : ($row['ref'] >= 50 && $row['ref'] <= 65 ? "geel" : ($row['ref'] > 65 && $row['ref'] <= 80 ? "oranje" : "rood")))."' style='width:".$row['ref']."%;'><span>".$row['ref']."</span></div></td>")."</tr>";
					echo "</table>";
					
					/* OPVRAGEN WELKE SKILLS HIJ HEEFT */
					if(!empty($row['special1']) || !empty($row['special2'])) {
						$skill_geplaatst = false;
						echo "<p class='skills'>";
						for($i = 0; $i < 2; $i++) {
							$value = 0;
							if($i == 0 && !empty($row['special1'])) {
								$value = $row['special1'];
							}
							if($i == 1 && !empty($row['special2'])) {
								$value = $row['special2'];
							}
							$skill = getSkill($value);
							if(!empty($skill)) {
								if($skill_geplaatst) {	echo "<br>";}
								echo $skill;
								$skill_geplaatst = true;
							}
						}
						echo "</p>";
					}
				echo "</div>";
				if($left == false) {
					echo "<div style='clear: both;'></div>";
				}
				($left ? $left = false : $left = true);
			}
						
		}
	}
}else {
		?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<title>Top spin 4</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	</head>
	<body>
		Log in om deze pagina te bekijken
	</body>
	</html>
	<?php
}
?>